//
//  ViewController.m
//  TestHSYAlertView
//
//  Created by Sean on 16/1/15.
//  Copyright (c) 2016年 seanhuang1661. All rights reserved.
//

#import "ViewController.h"
#import "HSYAlertView.h"

@interface ViewController () <HSYAlertViewDelegate>
- (IBAction)test1Action:(id)sender;
- (IBAction)test2Action:(id)sender;
- (IBAction)test3Action:(id)sender;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor clearColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)test1Action:(id)sender {
    HSYAttributedString *messege = [[HSYAttributedString alloc] init];
    messege.string = @"是大法官和进口量sfsd是否是否水电费水电费师傅说对方是否的风格会尽快风格和健康风格和丰富的地方放大幅度发大幅度发大幅度发大幅度发舒服舒服是电风扇健康了";
    messege.color = [UIColor purpleColor];
    messege.font = [UIFont fontWithName:@"ArialRoundedMTBold" size:12];
    messege.align = HSYAttributedStringAlignLeft;
    HSYAlertView *alertView = [[HSYAlertView alloc] initWithTitle:@"这是一个标题" cancel:@"取消" confirm:@"确定" delegate:self messege:messege];
    [alertView show];
}

- (IBAction)test2Action:(id)sender {
    HSYAttributedString *messege = [[HSYAttributedString alloc] init];
    messege.string = @"是大法发大幅度发大幅度发舒服舒服是电风扇健康了";
    messege.color = [UIColor magentaColor];
    messege.font = [UIFont fontWithName:@"ArialRoundedMTBold" size:20];
    messege.align = HSYAttributedStringAlignLeft;
    HSYAlertView *alertView = [[HSYAlertView alloc] initWithTitle:@"这是一个标题" cancel:@"Cancel" confirm:nil delegate:self messege:messege];
    [alertView show];
}

- (IBAction)test3Action:(id)sender {
    HSYAttributedString *msg1 = [[HSYAttributedString alloc] init];
    msg1.string = @"的风格会尽快";
    msg1.font = [UIFont fontWithName:@"ArialRoundedMTBold" size:10];
    msg1.color = [UIColor redColor];
    msg1.align = HSYAttributedStringAlignLeft;
    
    HSYAttributedString *msg2 = [[HSYAttributedString alloc] init];
    msg2.string = @"赶回家快乐";
    msg2.font = [UIFont fontWithName:@"ArialRoundedMTBold" size:20];
    msg2.color = [UIColor redColor];
    msg2.align = HSYAttributedStringAlignLeft;
    
    HSYAttributedString *msg3 = [[HSYAttributedString alloc] init];
    msg3.string = @"体育IOP回家";
    msg3.font = [UIFont fontWithName:@"ArialRoundedMTBold" size:15];
    msg3.color = [UIColor blueColor];
    msg3.align = HSYAttributedStringAlignLeft;
    
    HSYAttributedString *msg4 = [[HSYAttributedString alloc] init];
    msg4.string = @"推广会尽快赶回家看了会尽快了";
    msg4.font = [UIFont fontWithName:@"ArialRoundedMTBold" size:15];
    msg4.color = [UIColor greenColor];
    msg4.align = HSYAttributedStringAlignLeft;
    
    HSYAlertView *alertView = [[HSYAlertView alloc] initWithTitle:@"这是一个标题" cancel:@"取消" confirm:nil delegate:self messeges:msg1, msg2, msg3, msg4, nil];
    
    [alertView show];
}

- (void)alertView:(HSYAlertView *)alertView didDismissWithButtonType:(NSInteger)buttonType {
    if (buttonType == HSYAlertViewCancel) {
        NSLog(@"---取消---");
    } else {
        NSLog(@"---确定---");
    }
}
@end
